All Questions
27 questions
6votes
7answers
1kviews
Filter non-even elements from an array
I have a method that returns an int[]. The array is made by filtering out only the even values of the array passed into the method. It works, but it's really ugly ...
4votes
1answer
947views
Writing a Java program that outputs a calorie/macronutrient plan for getting in shape over a certain amount of weeks
I am new to programming and was working on a project that calculates an entire "diet plan" as well as a projected weight goal for each week. There are three objects that all have methods ...
7votes
1answer
1kviews
Polynomial multiplication using Karatsuba method
I am trying to solve a problem, which requires me to output the xor of all coefficients in the product of 2 input polynomials. Having seen that the normal O(n^2) ...
6votes
5answers
1kviews
Find greatest number in array that is a product of some two elements in the same array
Given an array a, find the greatest number in a that is a product of two elements in a. If there are no two elements in a that can be multiplied to produce another element contained in a, return -1. I ...
5votes
1answer
245views
Car Showroom Database: Taking user inputs and manipulating arrays
I've been learning C# for around 2 weeks and I'm feeling a bit more confident. I wrote this for general practice and am quite proud but hoping to make it faster and more efficient as I progress and ...
4votes
1answer
98views
Outputting flavor text depending on inputted strings
I have this program that takes two strings from the user, stores them in mixArray, then "mixes" them with mixItUp() and outputs ...
8votes
2answers
197views
Printing a 2-D array diagonally
The case scenario: A 2-D array is given: 1 3 6 10 15 2 5 9 14 19 4 8 13 18 22 7 12 17 21 24 11 16 20 23 25 and its size ...
4votes
1answer
259views
Inserting Elements Into a Sorted Array
Very new to JS (wrote my "Hello World" around 3 days ago), but not to programming in general. My documentation is inspired by the approach I followed for Python (since I haven't learned JS ...
6votes
2answers
3kviews
Find the largest sum of any slice inside an array
This is the 26th exercise I solved from Codility. It scores 100%. I think I improved a lot since I started with this lessons, around 2 months ago, but still every post I made had things to be improved....
3votes
1answer
699views
Count the number of leaders in both sides (slices) of an array in C#. Codility EquiLeaders task
EquiLeader A non-empty array A consisting of N integers is given. The leader of this array is the value that occurs in more than half of the elements of A. An equi leader is an ...
3votes
1answer
486views
Codility voracious fish are moving along a river, solution in C#
This is the task's description. My code gets 100% task score. Is it good code yet? (I think I'm getting a lot better, since I started solving this codility's exercises and posting here, but I always ...
1vote
2answers
437views
MaxProductOfThree in C#
This is my solution for the MaxProductOfThree from codility, it scores 100%, but I'm not a fan of the if if if structure it has going on. Task description ...
2votes
1answer
1kviews
Codility's GenomicRangeQuery solution in C#
I've been learning C# for a few months now, and I've done some basic things in java last year. I made a solution for the problem the title states, this is the task description. Task description ...
2votes
1answer
780views
Codility's count passing cars in opposite directions in C#
I programmed a few things in java and now I'm learning C#. I've been doing exercises from Codility. The first 3 or 4 were very difficult to me but now I guess I've got the hang of it. This site ...
5votes
2answers
2kviews
MaxCounters solution in C# from Codility
I programmed a little in java a while back, and now I'm learning C#.This is the first exercise of "medium" or "respectable" difficulty according to Codility, so I'm pretty pleased of finding out that ...